<?php


namespace App\Handlers;


class KeysHandler
{
    const ORDER_LIST = 'user:%d:orders:%s:%d:%d';    // 用户id:页码:条数

    const RECEIVE_ACCOUNT = 'user:%s_receive_account'; //用户收款账号列表
    const USER_GRABBING_ORDER_LOCK = 'user:%d_grabbing_orders_lock '; //用户抢单超时锁定

    const USER_PROFIT = 'user:%d_profit';   // 用户收益
    const USER_TEAM_PROFIT = 'user:%d_team_profit'; // 用户团队收益
    const USER_PROFIT_EXPIRE = 60;  //团队收益缓存
    const USER_SUBORDINATE = 'user:%d_subordinate:%d';  // 用户下级
    const USER_SUBORDINATE_PROFIT = 'user:%d_subordinate:%d_profits_page:%d_limit:%d'; // 用户下级收益（列表）
    const USER_ACCOUNT = 'account:%d_%s_%d_%d_%s';    // 用户账目明细 uid-type-page-limit-date

    const ORDER = 'order:id_%d';//订单缓存(利用订单id缓存)
    const ORDER_TTL = 60 * 60;//一个小时有效期

    const NOTICES = 'notices';   // 公告
    const TOP_NOTICE = 'top_notices';   // 置顶公告
    const NOTICE = 'notice:%d';  // 公告详情
    const NOTICE_EXPIRE = 60 * 60 * 24 * 7;

    const CONFIGURATION = 'configuration';  // 配置项
    const CONFIGURATION_EXPIRE = 60 * 60 * 24 * 7;

    const ACTIVITIES = 'activities';    // 活动列表
    const ACTIVITIES_PAGE = 'activities:%d:%d';    // 活动列表:页数:条数
    const ACTIVITY = 'activity:%d'; // 活动详情
    const ACTIVITY_RECEIVED = 'activity:%d_user:%d';    // 活动:id_用户:id
    const COMPLETE_FIRST_TRANSFER = 'user:%d:complete_First_Transfer';   // 用户是否完成第一次代付
    const SUBORDINATE_COMPLETE_PAYMENT = 'user:%d:subordinate_complete_payment';   // 用户完成代付的下级人数

    const MANUALS = 'manuals:%d:%d';    // 手册:page:limit
    const MANUAL = 'manuals:%d';    // 手册:page:limit

    const CUSTOMER = 'customer';    // 客服

    const ARTICLE = 'article:%s';   // 文章

    const TodayRecord = 'record:%s';    // 今日记录

    const USER_TEAM = 'user:%d:level:%d:page:%d:limit:%d:date:%s:showzero:%d';  // 团队

    const USER_LINK = 'user:%d_link'; //用户邀请连接
    const USER_LINK_BY_ORDER_ID = 'user:%d_%dlink'; //用户邀请连接
    const USER_LINK_BY_PAYMENT_DETAIL_ID = 'user:%d_%dlink'; //用户邀请连接
    const USER_LINK_EXPIRE = 60 * 60 * 24 * 7;

    const BANNER = 'banner:locale_%s_location_%s';//


    const USER_ALL_PARENT = 'user:%d_all_parent'; //用户所有邀请人

    const USER_NEED_GRAB_NUMBER = 'user:%d_need_grab_number'; //用户需要抢单的次数

    const GRAB_ORDER_ONLINE_USERS = 'grab_order:%d_online_users'; //抢单区间在线人数

    // 奖品相关
    const USER_PRIZE_LIST = 'user_%d_prizes_list';
    const PRIZE_TTL = 24 * 60 * 60;
    const PRIZE_LIST_BY_SORT = 'prize_list_column_%s_sort_%s';
    const PRIZE_BY_ID = 'prize_by_%d';

    const HOME_DATA = 'home_data'; //首页缓存
    const HOME_DATA_LOCK = 'home_data_lock'; //首页缓存锁

    const GOODS_CATEGORY_DATA = 'goods_category_data'; //商品分类缓存
    const GOODS_CATEGORY_DATA_LOCK = 'goods_category_data_lock'; //商品分类缓存锁

    const GOODS_LIST = 'welfare_goods_list_cid:%d_page:%d_limit:%d'; //商品列表缓存
    const GOODS_LIST_LOCK = 'welfare_goods_list_lock'; //商品列表缓存锁

    const WELFARE_GOODS_LIST = 'welfare_goods_list_page:%d_limit:%d'; //福利商品列表缓存
    const WELFARE_GOODS_LIST_LOCK = 'welfare_goods_list_lock'; //福利商品列表缓存锁

    const FLASH_GOODS_LIST = 'flash_goods_list_page:%d_limit:%d'; //福利商品列表缓存
    const FLASH_GOODS_LIST_LOCK = 'flash_goods_list_lock'; //福利商品列表缓存锁

    const SELL_GOODS_LIST = 'limit_purchase_goods_list_page:%d_limit:%d'; //二手商品列表缓存
    const SELL_GOODS_LIST_LOCK = 'limit_purchase_goods_list_lock'; //二手商品列表缓存锁

    const CART = 'cart:user_%d'; //购物车缓存
    const CART_EXPIRE = 24 * 60 * 60; //购物车缓存时长

    const CART_NUMBER = 'cart_number:user_%d'; //购物车数量缓存
    const CART_NUMBER_EXPIRE = 24 * 60 * 60; //购物车数量缓存时长
    const GOODS_LOGISTICS = 'good_order_id_%d_logistics'; // 物流信息
    const GOODS_TYPE_LOGISTICS = 'good_order_id_%d_%d_logistics'; // 物流信息

    const INDIA_ADDRESS_TTL = 24 * 60 * 60;
    const INDIA_ADDRESS_LIST = 'india_address_list'; //印度地址列表
    const INDIA_ADDRESS_BY_CODE = 'india_address_code:%s'; // 根据code查询地址详情

    const VN_ADDRESS_TTL = 7 * 24 * 60 * 60;
    const VN_ADDRESS_REGIONS = 'vn_address_regions'; //印度地址列表
    const VN_ADDRESS_DISTRICTS = 'vn_address_districts:%s'; // 根据code查询地址详情
    const VN_ADDRESS_WARDS = 'vn_address_wards:%s'; // 根据code查询地址详情

    const PH_ADDRESS_TTL = 7 * 24 * 60 * 60;
    const PH_ADDRESS_REGIONS = 'ph_address_regions'; //印度地址列表
    const PH_ADDRESS_DISTRICTS = 'ph_address_districts:%s'; // 根据code查询地址详情
    const PH_ADDRESS_WARDS = 'ph_address_wards:%s'; // 根据code查询地址详情


    const VIP_PRIZE_NUM_EVERY_DAY = 'user_id:%d_prize_num_every_day'; // 每天抽奖次数
    const VIP_PRIZE_NUM_LOCK = 'user_id:%d_prize_num_lock'; // 每天抽奖次数
    const VIP_BY_ID = 'vip:%d'; // vip
    const VIP_TTL = 10 * 60;

    const SALETASKCATES = 'sale_task_cates';

    const GRAB_LOGS = 'grab_logs';
    const GRAB_LOGS_EXPIRE = 1;// * 60 * 60;

    const GRAB_GOODS = 'grab_goods:%d';
    const GRAB_GOODS_EXPIRE = 1;// * 30 * 60;

    const USER_INFO = 'userinfo:%s:%s';
    const USER_INFO_TAG = 'userinfo_tag:%d';
    const USER_INFO_DATA_LOCK = 'userinfo_data_lock';

    const PAYMENT_THIRD_PAY_LIST = 'payment_third_pay_list';

    const ADS_CONFIGS = 'ads_configs';
    const ADS_CONFIGS_TTL = 5 * 60;

    const SHOP_STATISTICS_CLICK = 'shop_statistics_click:%s:%d';
    const SHOP_STATISTICS_CLICK_TTL = 5 * 60;

    const SHOP_STATISTICS_ORDER = 'shop_statistics_order:%s:%d';


    const NEW_USERS = 'new_users:%d';//注册用户
    const NEW_USERS_SHOP = 'new_users_shop:%d';//注册用户


    const RECHARGE_USERS = 'recharge_users:%d';//充值用户

    const YESTERDAY_RECHARGE = 'yesterday_recharge';//昨日充值

    const YESTERDAY_REGISTER_USERS = 'yesterday_register_users';//昨日注册用户
    const YESTERDAY_REGISTER_USERS_SHOP = 'yesterday_register_users_shop';//昨日注册用户


    const YESTERDAY_WITHDRAWAL = 'yesterday_withdraw';//昨日提现

    const YESTERDAY_PROFIT = 'yesterday_profit';//昨日盈利

}
